

const { injectBabelPlugin } = require('react-app-rewired');
const rewireLess = require('react-app-rewire-less');
 const path = require('path')
module.exports = function override(config, env) {
  // antd-mobile的组件按需加载
   config = injectBabelPlugin(['import', { libraryName: 'antd-mobile', style: true }], config);
  //  andt的颜色自定义
   config = rewireLess.withLoaderOptions({
     modifyVars: { "@brand-primary": "#55cbc4" , // 正常颜色
     "@brand-primary-tap": "#1cad82", //按 下
    
    },
   })(config, env);
  //  配置 stylus的编译加载器
   let loaderList = config.module.rules[1].oneOf;
   loaderList.splice(loaderList.length - 1, 0, {
     test: /\.styl$/,
     use: ["style-loader", "css-loader", "stylus-loader"]
   });
// config.alias = {
//   "@" : './src'
// }
config.resolve.alias["@"] = path.resolve(__dirname, "./src")


    return config;
};
